/***
 * 依赖管理
 */
require.config({
    baseUrl : "_static_",
    paths : {
        "axios" : ["https://unpkg.com/axios/dist/axios.min"], 
        "Vue" : ["https://cdn.jsdelivr.net/npm/vue/dist/vue.min"], 
        "VueRouter" : ["https://unpkg.com/vue-router/dist/vue-router.min"], 
        "jquery" : ["https://cdn.staticfile.org/jquery/1.12.4/jquery.min"], 
        "echarts" : ["http://gallerybox.echartsjs.com/dep/echarts/latest/echarts.min"]
    }
});

/**
 * 主入口
 */
require( [
    'Vue', 'VueRouter', 'IndexComponent', 'ForceGraphComponent', 'GraphDataComponent', 'SystemInfoComponent', 'SystemPropertyComponent', 'ProviderListComponent', 'ProviderComponent', 'ShardingComponent'
], function ( 
    Vue, VueRouter, IndexComponent, ForceGraphComponent, GraphDataComponent, SystemInfoComponent, SystemPropertyComponent, ProviderListComponent, ProviderComponent, ShardingComponent
) {
    Vue.use(VueRouter); // 必须的

    var routes = [
        { path: '/', component: IndexComponent },
        { path: '/force-graph', component: ForceGraphComponent },
        { path: '/graph-data', component: GraphDataComponent },
        { path: '/system-info', component: SystemInfoComponent },
        { path: '/system-property', component: SystemPropertyComponent },
        { path: '/sharding', component: ShardingComponent }
    ];

    var router = new VueRouter({ routes });

    var app = new Vue({ 
        router 
    }).$mount('#app');
});
